<?php
namespace Admin\Controller;
class QiandanController extends IsloginController{
    function oper(){
        $Ob= M("Qiandan");
        $qiandan = $Ob->select();
        $this->assign('qiandan',$qiandan);
        $this->display();
    }
    function add(){
        $this->display();
    }
    function tianjia(){
        $qiandanOb = M("Qiandan");
        $_POST["addtime"]=time();
        $re = $qiandanOb->data($_POST)->add();
        if($re){
            $this->success('添加成功',U('Qiandan/oper'));
        }else{
            $this->error('添加失败',U('Qiandan/oper'));
        }
    }
    function del(){
        $delOb = M("Qiandan");
        $id = $_POST["id"];
        $re = $delOb->where("id=$id")->delete();
        if($re){
            echo json_encode(array('msg'=>1));
        }
    }
}